\(\int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x)) \, dx\) [1206]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 25, antiderivative size = 85 \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x)) \, dx=\frac {2 a \csc (c+d x)}{d}-\frac {b \csc ^2(c+d x)}{2 d}-\frac {a \csc ^3(c+d x)}{3 d}-\frac {2 b \log (\sin (c+d x))}{d}+\frac {a \sin (c+d x)}{d}+\frac {b \sin ^2(c+d x)}{2 d} \]

[Out]

2*a*csc(d*x+c)/d-1/2*b*csc(d*x+c)^2/d-1/3*a*csc(d*x+c)^3/d-2*b*ln(sin(d*x+c))/d+a*sin(d*x+c)/d+1/2*b*sin(d*x+c
)^2/d

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {2916, 12, 780} \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x)) \, dx=\frac {a \sin (c+d x)}{d}-\frac {a \csc ^3(c+d x)}{3 d}+\frac {2 a \csc (c+d x)}{d}+\frac {b \sin ^2(c+d x)}{2 d}-\frac {b \csc ^2(c+d x)}{2 d}-\frac {2 b \log (\sin (c+d x))}{d} \]

[In]

Int[Cos[c + d*x]*Cot[c + d*x]^4*(a + b*Sin[c + d*x]),x]

[Out]

(2*a*Csc[c + d*x])/d - (b*Csc[c + d*x]^2)/(2*d) - (a*Csc[c + d*x]^3)/(3*d) - (2*b*Log[Sin[c + d*x]])/d + (a*Si
n[c + d*x])/d + (b*Sin[c + d*x]^2)/(2*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 780

Int[((e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(e*x
)^m*(f + g*x)*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, e, f, g, m}, x] && IGtQ[p, 0]

Rule 2916

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d/b)*x)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {b^4 (a+x) \left (b^2-x^2\right )^2}{x^4} \, dx,x,b \sin (c+d x)\right )}{b^5 d} \\ & = \frac {\text {Subst}\left (\int \frac {(a+x) \left (b^2-x^2\right )^2}{x^4} \, dx,x,b \sin (c+d x)\right )}{b d} \\ & = \frac {\text {Subst}\left (\int \left (a+\frac {a b^4}{x^4}+\frac {b^4}{x^3}-\frac {2 a b^2}{x^2}-\frac {2 b^2}{x}+x\right ) \, dx,x,b \sin (c+d x)\right )}{b d} \\ & = \frac {2 a \csc (c+d x)}{d}-\frac {b \csc ^2(c+d x)}{2 d}-\frac {a \csc ^3(c+d x)}{3 d}-\frac {2 b \log (\sin (c+d x))}{d}+\frac {a \sin (c+d x)}{d}+\frac {b \sin ^2(c+d x)}{2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.89 \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x)) \, dx=\frac {2 a \csc (c+d x)}{d}-\frac {a \csc ^3(c+d x)}{3 d}+\frac {a \sin (c+d x)}{d}-\frac {b \left (\csc ^2(c+d x)+4 \log (\sin (c+d x))-\sin ^2(c+d x)\right )}{2 d} \]

[In]

Integrate[Cos[c + d*x]*Cot[c + d*x]^4*(a + b*Sin[c + d*x]),x]

[Out]

(2*a*Csc[c + d*x])/d - (a*Csc[c + d*x]^3)/(3*d) + (a*Sin[c + d*x])/d - (b*(Csc[c + d*x]^2 + 4*Log[Sin[c + d*x]
] - Sin[c + d*x]^2))/(2*d)

Maple [A] (verified)

Time = 0.55 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.42

method result size
derivativedivides \(\frac {a \left (-\frac {\cos ^{6}\left (d x +c \right )}{3 \sin \left (d x +c \right )^{3}}+\frac {\cos ^{6}\left (d x +c \right )}{\sin \left (d x +c \right )}+\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )\right )+b \left (-\frac {\cos ^{6}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{4}\left (d x +c \right )\right )}{2}-\left (\cos ^{2}\left (d x +c \right )\right )-2 \ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) \(121\)
default \(\frac {a \left (-\frac {\cos ^{6}\left (d x +c \right )}{3 \sin \left (d x +c \right )^{3}}+\frac {\cos ^{6}\left (d x +c \right )}{\sin \left (d x +c \right )}+\left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )\right )+b \left (-\frac {\cos ^{6}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\left (\cos ^{4}\left (d x +c \right )\right )}{2}-\left (\cos ^{2}\left (d x +c \right )\right )-2 \ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) \(121\)
parallelrisch \(\frac {32 \ln \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b -32 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b -3 \left (\csc ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (a \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\cos \left (2 d x +2 c \right )-\frac {\cos \left (4 d x +4 c \right )}{12}-\frac {25}{36}\right ) \csc \left (\frac {d x}{2}+\frac {c}{2}\right )+\frac {2 b \left (\frac {1}{8}-\frac {\cos \left (4 d x +4 c \right )}{8}+\cos \left (2 d x +2 c \right )\right )}{3}\right ) \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{16 d}\) \(127\)
risch \(2 i x b -\frac {b \,{\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {i a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {b \,{\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}+\frac {4 i b c}{d}+\frac {2 i \left (6 a \,{\mathrm e}^{5 i \left (d x +c \right )}-8 a \,{\mathrm e}^{3 i \left (d x +c \right )}-3 i b \,{\mathrm e}^{4 i \left (d x +c \right )}+6 a \,{\mathrm e}^{i \left (d x +c \right )}+3 i b \,{\mathrm e}^{2 i \left (d x +c \right )}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}-\frac {2 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}\) \(177\)
norman \(\frac {-\frac {a}{24 d}+\frac {19 a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}+\frac {55 a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {55 a \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {19 a \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}-\frac {a \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}-\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d}-\frac {b \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}+\frac {9 b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}-\frac {2 b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 b \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) \(206\)

[In]

int(cos(d*x+c)^5*csc(d*x+c)^4*(a+b*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(-1/3/sin(d*x+c)^3*cos(d*x+c)^6+1/sin(d*x+c)*cos(d*x+c)^6+(8/3+cos(d*x+c)^4+4/3*cos(d*x+c)^2)*sin(d*x+c
))+b*(-1/2/sin(d*x+c)^2*cos(d*x+c)^6-1/2*cos(d*x+c)^4-cos(d*x+c)^2-2*ln(sin(d*x+c))))

Fricas [A] (verification not implemented)

none

Time = 0.40 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.38 \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {12 \, a \cos \left (d x + c\right )^{4} - 48 \, a \cos \left (d x + c\right )^{2} + 24 \, {\left (b \cos \left (d x + c\right )^{2} - b\right )} \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) \sin \left (d x + c\right ) + 3 \, {\left (2 \, b \cos \left (d x + c\right )^{4} - 3 \, b \cos \left (d x + c\right )^{2} - b\right )} \sin \left (d x + c\right ) + 32 \, a}{12 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^4*(a+b*sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/12*(12*a*cos(d*x + c)^4 - 48*a*cos(d*x + c)^2 + 24*(b*cos(d*x + c)^2 - b)*log(1/2*sin(d*x + c))*sin(d*x + c
) + 3*(2*b*cos(d*x + c)^4 - 3*b*cos(d*x + c)^2 - b)*sin(d*x + c) + 32*a)/((d*cos(d*x + c)^2 - d)*sin(d*x + c))

Sympy [F(-1)]

Timed out. \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x)) \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**5*csc(d*x+c)**4*(a+b*sin(d*x+c)),x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.81 \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x)) \, dx=\frac {3 \, b \sin \left (d x + c\right )^{2} - 12 \, b \log \left (\sin \left (d x + c\right )\right ) + 6 \, a \sin \left (d x + c\right ) + \frac {12 \, a \sin \left (d x + c\right )^{2} - 3 \, b \sin \left (d x + c\right ) - 2 \, a}{\sin \left (d x + c\right )^{3}}}{6 \, d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^4*(a+b*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/6*(3*b*sin(d*x + c)^2 - 12*b*log(sin(d*x + c)) + 6*a*sin(d*x + c) + (12*a*sin(d*x + c)^2 - 3*b*sin(d*x + c)
- 2*a)/sin(d*x + c)^3)/d

Giac [A] (verification not implemented)

none

Time = 0.35 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.95 \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x)) \, dx=\frac {3 \, b \sin \left (d x + c\right )^{2} - 12 \, b \log \left ({\left | \sin \left (d x + c\right ) \right |}\right ) + 6 \, a \sin \left (d x + c\right ) + \frac {22 \, b \sin \left (d x + c\right )^{3} + 12 \, a \sin \left (d x + c\right )^{2} - 3 \, b \sin \left (d x + c\right ) - 2 \, a}{\sin \left (d x + c\right )^{3}}}{6 \, d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^4*(a+b*sin(d*x+c)),x, algorithm="giac")

[Out]

1/6*(3*b*sin(d*x + c)^2 - 12*b*log(abs(sin(d*x + c))) + 6*a*sin(d*x + c) + (22*b*sin(d*x + c)^3 + 12*a*sin(d*x
 + c)^2 - 3*b*sin(d*x + c) - 2*a)/sin(d*x + c)^3)/d

Mupad [B] (verification not implemented)

Time = 11.43 (sec) , antiderivative size = 218, normalized size of antiderivative = 2.56 \[ \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x)) \, dx=\frac {23\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\frac {89\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{3}-2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\frac {19\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}-b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {a}{3}}{d\,\left (8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\right )}+\frac {7\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {2\,b\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{d}-\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {2\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]

[In]

int((cos(c + d*x)^5*(a + b*sin(c + d*x)))/sin(c + d*x)^4,x)

[Out]

((19*a*tan(c/2 + (d*x)/2)^2)/3 - b*tan(c/2 + (d*x)/2) - a/3 + (89*a*tan(c/2 + (d*x)/2)^4)/3 + 23*a*tan(c/2 + (
d*x)/2)^6 - 2*b*tan(c/2 + (d*x)/2)^3 + 15*b*tan(c/2 + (d*x)/2)^5)/(d*(8*tan(c/2 + (d*x)/2)^3 + 16*tan(c/2 + (d
*x)/2)^5 + 8*tan(c/2 + (d*x)/2)^7)) + (7*a*tan(c/2 + (d*x)/2))/(8*d) + (2*b*log(tan(c/2 + (d*x)/2)^2 + 1))/d -
 (a*tan(c/2 + (d*x)/2)^3)/(24*d) - (b*tan(c/2 + (d*x)/2)^2)/(8*d) - (2*b*log(tan(c/2 + (d*x)/2)))/d